/*
 * @Autor: dingxiaolin
 * @Date: 2021-06-02 13:12:43
 * @LastEditors: dingxiaolin
 * @LastEditTime: 2021-06-08 12:16:22
 */
import { RouteRecordRaw } from 'vue-router'
import { IAsyncRouteState } from './state'

export const mutations = {
    setRouters: (state: IAsyncRouteState, routers): void => {
        // 设置动态路由
        state.menus = routers
    },
    setAsyncRouters: (state: IAsyncRouteState, routers): void => {
        state.asyncMenus = routers
    },
    setKeepAliveComponents: (state: IAsyncRouteState, compNames): void => {
        // 设置需要缓存的组件
        state.keepAliveComponents = compNames
    }
}
